package com.ubing.boot.notesforjava.utils;

import sun.misc.Unsafe;

import java.lang.reflect.Field;

/**
 * @ClassName : unSafeUtils
 * @Description : unSafeUtils
 * @Author : ubing
 * @Date: 2023-02-11 09:47
 */
public class unSafeUtils {
    public static Unsafe getInstance() throws NoSuchFieldException, IllegalAccessException {
            Field  theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
            theUnsafe.setAccessible(true);
            return (Unsafe) theUnsafe.get(null);
    }
}
